﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="QuizDetailsDataSet" targetNamespace="http://tempuri.org/QuizDetailsDataSet.xsd" xmlns:mstns="http://tempuri.org/QuizDetailsDataSet.xsd" xmlns="http://tempuri.org/QuizDetailsDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="ApplicationServices" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="ApplicationServices (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.ApplicationServices.ConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="QuizAnswersTableAdapter" GeneratorDataComponentClassName="QuizAnswersTableAdapter" Name="QuizAnswers" UserDataComponentName="QuizAnswersTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="ApplicationServices (Web.config)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        q.Name AS QuizName, qd.QuestionText AS Question, qa.AnswerText AS Answer, qa.CorrectAnswerText AS CorrectAnswer, qt.Name AS QuizTaker, qa.Result, 
(CASE WHEN qa.Result = 'Undetermined' THEN 1 ELSE 0 END) AS IsUndertermined,
                         (CASE WHEN qa.Result = 'Correct' THEN 1 ELSE 0 END) AS IsCorrect
FROM          GiveAQuiz.QuizAnswers AS qa INNER JOIN
                        GiveAQuiz.QuizResults AS qr ON qa.QuizResult = qr.Id INNER JOIN
                        GiveAQuiz.QuestionDefinitions AS qd ON qa.QuestionDefinition = qd.Id INNER JOIN
                        GiveAQuiz.QuizTakers AS qt ON qr.QuizTaker = qt.Id INNER JOIN
                        GiveAQuiz.Quizzes AS q ON qr.Quiz = q.Id
WHERE        (qr.Id = @QuizResultsId)
ORDER BY      qd.SortOrder</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="QuizResultsId" ColumnName="Id" DataSourceName="QuizDB.GiveAQuiz.QuizResults" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@QuizResultsId" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Id" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Question" DataSetColumn="Question" />
              <Mapping SourceColumn="Answer" DataSetColumn="Answer" />
              <Mapping SourceColumn="CorrectAnswer" DataSetColumn="CorrectAnswer" />
              <Mapping SourceColumn="QuizTaker" DataSetColumn="QuizTaker" />
              <Mapping SourceColumn="QuizName" DataSetColumn="QuizName" />
              <Mapping SourceColumn="Result" DataSetColumn="Result" />
              <Mapping SourceColumn="IsCorrect" DataSetColumn="IsCorrect" />
              <Mapping SourceColumn="IsUndertermined" DataSetColumn="IsUndertermined" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="QuizDetailsDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="QuizDetailsDataSet" msprop:Generator_UserDSName="QuizDetailsDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="QuizAnswers" msprop:Generator_TableClassName="QuizAnswersDataTable" msprop:Generator_TableVarName="tableQuizAnswers" msprop:Generator_TablePropName="QuizAnswers" msprop:Generator_RowDeletingName="QuizAnswersRowDeleting" msprop:Generator_UserTableName="QuizAnswers" msprop:Generator_RowChangingName="QuizAnswersRowChanging" msprop:Generator_RowEvHandlerName="QuizAnswersRowChangeEventHandler" msprop:Generator_RowDeletedName="QuizAnswersRowDeleted" msprop:Generator_RowEvArgName="QuizAnswersRowChangeEvent" msprop:Generator_RowChangedName="QuizAnswersRowChanged" msprop:Generator_RowClassName="QuizAnswersRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Question" msprop:Generator_ColumnVarNameInTable="columnQuestion" msprop:Generator_ColumnPropNameInRow="Question" msprop:Generator_ColumnPropNameInTable="QuestionColumn" msprop:Generator_UserColumnName="Question" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Answer" msprop:Generator_ColumnVarNameInTable="columnAnswer" msprop:Generator_ColumnPropNameInRow="Answer" msprop:Generator_ColumnPropNameInTable="AnswerColumn" msprop:Generator_UserColumnName="Answer">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CorrectAnswer" msprop:Generator_ColumnVarNameInTable="columnCorrectAnswer" msprop:Generator_ColumnPropNameInRow="CorrectAnswer" msprop:Generator_ColumnPropNameInTable="CorrectAnswerColumn" msprop:Generator_UserColumnName="CorrectAnswer">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="QuizTaker" msprop:Generator_ColumnVarNameInTable="columnQuizTaker" msprop:Generator_ColumnPropNameInRow="QuizTaker" msprop:Generator_ColumnPropNameInTable="QuizTakerColumn" msprop:Generator_UserColumnName="QuizTaker">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="QuizName" msprop:Generator_ColumnVarNameInTable="columnQuizName" msprop:Generator_ColumnPropNameInRow="QuizName" msprop:Generator_ColumnPropNameInTable="QuizNameColumn" msprop:Generator_UserColumnName="QuizName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Result" msprop:Generator_ColumnVarNameInTable="columnResult" msprop:Generator_ColumnPropNameInRow="Result" msprop:Generator_ColumnPropNameInTable="ResultColumn" msprop:Generator_UserColumnName="Result">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="IsCorrect" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnIsCorrect" msprop:Generator_ColumnPropNameInRow="IsCorrect" msprop:Generator_ColumnPropNameInTable="IsCorrectColumn" msprop:Generator_UserColumnName="IsCorrect" type="xs:int" minOccurs="0" />
              <xs:element name="IsUndertermined" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnIsUndertermined" msprop:Generator_ColumnPropNameInRow="IsUndertermined" msprop:Generator_ColumnPropNameInTable="IsUnderterminedColumn" msprop:Generator_UserColumnName="IsUndertermined" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>